package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.systemsetup;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.systemsetup.SystemsetupService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 通知公告控制器
 */
@Action
@RequestMapping(value = "systemsetup/systemsetup")
public class SystemsetupController extends BaseController {
    @Resource
    public SystemsetupService systemsetupService;

    /**
     * 登录
     *
     * @param
     * @return
     */
    @At(value = "login", method = RequestMethod.POST, param = {"accountname", "accountpassword"})
    public RespEntity login(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.login(jsonParam);
    }

    /**
     * 刷新token
     *
     * @param
     * @return
     */
    @At(value = "refresh", method = RequestMethod.POST)
    public RespEntity refresh(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.refresh(jsonParam);
    }

    /**
     * 登出短token
     *
     * @param
     * @return
     */
    @At(value = "logout", method = RequestMethod.DELETE)
    public RespEntity logout(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.logout(jsonParam);
    }

    /**
     * 登出长token
     *
     * @param
     * @return
     */
    @At(value = "logout2", method = RequestMethod.DELETE)
    public RespEntity logout2(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.logout2(jsonParam);
    }

    /**
     * 维保到消防重定向
     *
     * @param
     * @return
     */
    @At(value = "redirect", method = RequestMethod.POST)
    public RespEntity redirect(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.redirect(jsonParam);
    }

    /**
     * 机构新增
     *
     * @param name:机构名称; des:机构描述; pid:所属机构的id;
     * @return
     */
    @At(value = "orgAdd", method = RequestMethod.POST, param = {"name", "pid"})
    public RespEntity orgAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.orgAdd(jsonParam);
    }

    /**
     * 账号密码修改
     *
     * @param jsonParam
     * @return
     */
    @At(value = "updatePassWord", method = RequestMethod.POST, param = {"oldPwd", "newPwd"})
    public RespEntity updatePassWord(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.updatePassWord(jsonParam);
    }

    /**
     * 机构删除
     *
     * @param
     * @return
     */
    @At(value = "orgDelete", method = RequestMethod.POST, param = {"id"})
    public RespEntity orgDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.orgDelete(jsonParam);
    }

    /**
     * 机构修改
     *
     * @param id:机构id; name:机构名称; des:机构描述;
     * @return
     */
    @At(value = "orgUpdate", method = RequestMethod.POST, param = {"id", "name"})
    public RespEntity orgUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.orgUpdate(jsonParam);
    }

    /**
     * 机构树形菜单
     *
     * @param
     * @return
     */
    @At(value = "orgTreeList", method = RequestMethod.GET)
    public RespEntity orgTreeList(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.orgTreeList(jsonParam);
    }
    /**
     * 根据父级ID获取机构
     *
     * @param
     * @return
     */
    @At(value = "getPidOrgList", method = RequestMethod.GET)
    public RespEntity getPidOrgList(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.getPidOrgList(jsonParam);
    }

    /**
     * 机构详情
     *
     * @param
     * @return
     */
    @At(value = "orgDetail", method = RequestMethod.GET, param = {"id"})
    public RespEntity orgDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.orgDetail(jsonParam);
    }

    /**
     * 微信授权
     *
     * @param jsonParam
     * @return
     */
    @At(value = "authorize", method = RequestMethod.POST)
    public RespEntity authorize(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.authorize(jsonParam);
    }

    /**
     * 账号新增
     *
     * @param name:真实姓名; accountname:登录账号; accountpassword:登录密码; phone:手机号码;
     *                   email:电子邮箱;permissionIds:所有的权限id字符串，中间用逗号分隔;
     *                   roles:所有的角色id字符串，中间用逗号分隔; homeId:所属机构的id
     * @return
     */
    @At(value = "userAdd", method = RequestMethod.POST, param = {"accountname", "accountpassword", "type"})
    public RespEntity userAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.userAdd(jsonParam);
    }

    /**
     * 账号修改
     *
     * @param name:真实姓名; accountname:登录账号; accountpassword:登录密码; phone:手机号码;
     *                   email:电子邮箱;permissionIds:所有的权限id字符串，中间用逗号分隔;
     *                   roles:所有的角色id字符串，中间用逗号分隔; homeId:所属机构的id;
     *                   id:用户id
     * @return
     */
    @At(value = "userUpdate", method = RequestMethod.POST, param = {"accountname", "accountpassword", "id"})
    public RespEntity userUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.userUpdate(jsonParam);
    }

    /**
     * 账号删除
     *
     * @param id:用户id
     * @return
     */
    @At(value = "userDelete", method = RequestMethod.POST, param = {"id"})
    public RespEntity userDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.userDelete(jsonParam);
    }

    /**
     * 账号列表
     *
     * @param param:账号、姓名、手机同时模糊查询; queryhomeId:查询的组织机构或者单位的id
     * @return
     */
    @At(value = "userListPage", method = RequestMethod.GET, param = {"page", "limit"})
    public RespEntity userListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.userListPage(jsonParam);
    }

    /**
     * 账号详情
     *
     * @param id:用户id
     * @return
     */
    @At(value = "userDetail", method = RequestMethod.GET, param = {"id"})
    public RespEntity userDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.userDetail(jsonParam);
    }

    /**
     * 机构和子机构列表
     *
     * @param orgId:机构id
     * @return
     */
    @At(value = "orgAllList", method = RequestMethod.GET)
    public RespEntity orgAllList(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.orgAllList(jsonParam);
    }

    /**
     * 账号不分页列表
     *
     * @param type:账户类型：1 机构账户  2 单位账户; isUse:是否在用：1 启用  2 停用;
     *                    accountname:登录账号; name:真实姓名; param:账号、姓名、手机同时模糊查询;
     *                    homeId:查询的组织机构或者单位的id;
     * @return
     */
    @At(value = "userList", method = RequestMethod.GET)
    public RespEntity userList(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.userList(jsonParam);
    }

    /**
     * 根据homeId获取user信息
     *
     * @param jsonParam
     * @return
     */
    @At(value = "getUserList", method = RequestMethod.GET)
    public RespEntity getUserList(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.getUserList(jsonParam);
    }

    /**
     * 账号权限列表（新增账号的时候用）
     *
     * @param
     * @return
     */
    @At(value = "permissionList", method = RequestMethod.GET)
    public RespEntity permissionList(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.permissionList(jsonParam);
    }

    /**
     * 单一机构账户列表
     * homeId	查询的组织机构  是
     *
     * @param
     * @return
     */
    @At(value = "userListByOrgId", method = RequestMethod.GET, param = {"homeId"})
    public RespEntity userListByOrgId(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.userListByOrgId(jsonParam);
    }

    /**
     * @param params
     * @return
     * @Title: getNewestVersionUpdate <br>
     * @Description: (获取最新版本) <br>
     * @author 石延杰<br>
     */
    @At(path = "getNewestVersionUpdate", method = RequestMethod.GET)
    public RespEntity getNewestVersionUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.getNewestVersionUpdate(jsonParam);
    }

    //获取标题图片
    @At(path = "getHeaderTitle", method = RequestMethod.GET)
    public RespEntity getHeaderTitle(@RequestBody(required = false) JSONObject jsonParam) {
        return systemsetupService.getHeaderTitle(jsonParam);
    }

    /**
     * 设置文字标题
     *
     * @param jsonParam
     * @return
     */
    @At(value = "setTextTitle", method = RequestMethod.POST)
    public RespEntity setTextTitle(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.setTextTitle(jsonParam);
    }

    /**
     * 获取文字标题
     *
     * @param jsonParam
     * @return
     */
    @At(value = "getTextTitle", method = RequestMethod.GET)
    public RespEntity getTextTitle(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.getTextTitle(jsonParam);
    }

    /**
     * 获取首页布局信息
     *
     * @param jsonParam
     * @return
     */
    @At(value = "getHomePageLayoutList", method = RequestMethod.GET)
    public RespEntity getHomePageLayoutList(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.getHomePageLayoutList(jsonParam);
    }

    /**
     * 设置首页布局信息
     *
     * @param jsonParam
     * @return
     */
    @At(value = "setHomePageLayoutList", method = RequestMethod.POST)
    public RespEntity setHomePageLayoutList(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.setHomePageLayoutList(jsonParam);
    }

    /**
     * 权限列表
     *
     * @param jsonParam
     * @return
     */
    @At(value = "permissionsTreeList", method = RequestMethod.GET)
    public RespEntity permissionsTreeList(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.permissionsTreeList(jsonParam);
    }

    /**
     * 角色新增
     *
     * @param jsonParam
     * @return
     */
    @At(value = "roleAdd", method = RequestMethod.POST)
    public RespEntity roleAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.roleAdd(jsonParam);
    }

    /**
     * 角色删除
     *
     * @param jsonParam
     * @return
     */
    @At(value = "roleDelete", method = RequestMethod.POST)
    public RespEntity roleDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.roleDelete(jsonParam);
    }

    /**
     * 角色详情
     *
     * @param jsonParam
     * @return
     */
    @At(value = "roleDetail", method = RequestMethod.GET)
    public RespEntity roleDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.roleDetail(jsonParam);
    }

    /**
     * 角色编辑
     *
     * @param jsonParam
     * @return
     */
    @At(value = "roleUpdate", method = RequestMethod.POST)
    public RespEntity roleUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.roleUpdate(jsonParam);
    }

    /**
     * 角色分页列表
     *
     * @param jsonParam
     * @return
     */
    @At(value = "roleListPage", method = RequestMethod.GET)
    public RespEntity roleListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.roleListPage(jsonParam);
    }

    /**
     * 角色不分页列表
     *
     * @param jsonParam
     * @return
     */
    @At(value = "roleListNoPage", method = RequestMethod.GET)
    public RespEntity roleListNoPage(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.roleListNoPage(jsonParam);
    }

    /**
     * 授权
     *
     * @param jsonParam
     * @return
     */
    @At(value = "authorization", method = RequestMethod.POST)
    public RespEntity authorization(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.authorization(jsonParam);
    }

    /**
     * 取消授权
     *
     * @param jsonParam
     * @return
     */
    @At(value = "cancelAuthorization", method = RequestMethod.POST)
    public RespEntity cancelAuthorization(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.cancelAuthorization(jsonParam);
    }

    /**
     * 被授权机构列表
     *
     * @param jsonParam
     * @return
     */
    @At(value = "getOrgAllList", method = RequestMethod.GET)
    public RespEntity getOrgAllList(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.getOrgAllList(jsonParam);
    }
    /**
     * 设置处置弹框
     *
     * @param jsonParam
     * @return
     */
    @At(value = "setFrameMonitoring", method = RequestMethod.POST)
    public RespEntity setFrameMonitoring(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.setFrameMonitoring(jsonParam);
    }

    /**
     * 设置处置弹框详情
     *
     * @param jsonParam
     * @return
     */
    @At(value = "frameMonitoringDetails", method = RequestMethod.GET)
    public RespEntity frameMonitoringDetails(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.frameMonitoringDetails(jsonParam);
    }


    /**
     * 大屏设置
     *
     * @param jsonParam
     * @return
     */
    @At(value = "largeScreenSettings", method = RequestMethod.POST)
    public RespEntity largeScreenSettings(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.largeScreenSettings(jsonParam);
    }

    /**
     * 大屏设置列表
     *
     * @param jsonParam
     * @return
     */
    @At(value = "largeScreenList", method = RequestMethod.GET)
    public RespEntity largeScreenList(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.largeScreenList(jsonParam);
    }

    /**
     * 大屏设置删除
     *
     * @param jsonParam
     * @return
     */
    @At(value = "largeScreenDel", method = RequestMethod.POST)
    public RespEntity largeScreenDel(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.largeScreenDel(jsonParam);
    }

    /**
     * 创建舆情平台子帐号并绑定
     *
     * @param jsonParam
     * @return
     */
    @At(value = "accountContactCreateSub", method = RequestMethod.POST)
    public RespEntity accountContactCreateSub(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.accountContactCreateSub(jsonParam);
    }

    /**
     * 免鉴权平台用户验证并登录
     *
     * @param jsonParam
     * @return
     */
    @At(value = "accountContactCheck", method = RequestMethod.POST)
    public RespEntity accountContactCheck(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.accountContactCheck(jsonParam);
    }

    /**
     * 注册
     *
     * @param jsonParam
     * @return
     */
    @At(value = "register", method = RequestMethod.POST)
    public RespEntity register(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.register(jsonParam);
    }

    /**
     * 更新用户绑定单位
     *
     * @param jsonParam
     * @return
     */
    @At(value = "updateUserHomeId", method = RequestMethod.POST)
    public RespEntity updateUserHomeId(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.updateUserHomeId(jsonParam);
    }

    /**
     * 获取验证码（找回密码用）
     *
     * @param jsonParam
     * @return
     */
    @At(value = "getVerificationCode", method = RequestMethod.POST)
    public RespEntity getVerificationCode(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.getVerificationCode(jsonParam);
    }

    /**
     * 身份验证（找回密码用）
     *
     * @param jsonParam
     * @return
     */
    @At(value = "identityVerification", method = RequestMethod.POST)
    public RespEntity identityVerification(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.identityVerification(jsonParam);
    }

    /**
     * 密码重置（找回密码用）
     *
     * @param jsonParam
     * @return
     */
    @At(value = "passwordReset", method = RequestMethod.POST)
    public RespEntity passwordReset(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.passwordReset(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 置顶应用新增
     * @Date Created in 14:25 2024/5/11
     * @Param [jsonParam]
     */

    @At(value = "topAppAdd", method = RequestMethod.POST)
    public RespEntity topAppAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.topAppAdd(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 置顶应用删除
     * @Date Created in 14:25 2024/5/11
     * @Param [jsonParam]
     */

    @At(value = "topAppDel", method = RequestMethod.POST)
    public RespEntity topAppDel(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.topAppDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 置顶应用列表
     * @Date Created in 14:25 2024/5/11
     * @Param [jsonParam]
     */

    @At(value = "topAppList", method = RequestMethod.GET)
    public RespEntity topAppList(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.topAppList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 更新记录新增、编辑
     * @Date Created in 14:25 2024/5/11
     * @Param [jsonParam]
     */

    @At(value = "renewInfoAddOrUpdate", method = RequestMethod.POST)
    public RespEntity renewInfoAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.renewInfoAddOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 更新记录分页列表
     * @Date Created in 14:25 2024/5/11
     * @Param [jsonParam]
     */

    @At(value = "renewInfoListPage", method = RequestMethod.GET)
    public RespEntity renewInfoListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return this.systemsetupService.renewInfoListPage(jsonParam);
    }

}
